<?php
// +----------------------------------------------------------------------
// | OneThink [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013 http://www.onethink.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: 麦当苗儿 <zuojiazi@vip.qq.com> <http://www.zjzit.cn>
// +----------------------------------------------------------------------

namespace Home\Controller;
use OT\DataDictionary;

/**
 * 前台首页控制器
 * 主要获取首页聚合数据
 */
class IndexController extends HomeController
{

	//系统首页
    public function index()
    {

        $carousels = new \Document\Model\Carousel\Home\GetIndexCarouselModel();
        $carousel = $carousels->get();

        $product=D(Document);
        $condition1['category_id']=48;
        $condition1['status']=1;
        $product_list=$product->where($condition1)->field('id , cover_id , title')->order('id desc')->limit(3)->select();

		/*$content_article=D('DocumentContentArticle');
		foreach($product_list as $v){
			$where['id']=$v['id'];
			$goodlists[]=$content_article->where($where)->field('index_images')->select();
			}
			var_dump($goodlists);*/
        $this->assign('carousel',$carousel);//轮播图片
        $this->assign('product_list',$product_list);//产品标题

        $this->display();
    }



}